<template>
  <Tabs :tabs="tabList" @change="changeTab"></Tabs>
</template>

<script setup lang="ts">
import Tabs from '@/components/utils-components/tab/Tabs.vue'
import { ref, onMounted } from 'vue'
const tabList = ref<{ name: string; isActive: boolean; }[]>([
  { name: '测试1', isActive: true },
  { name: '测试2', isActive: false },
  { name: '测试3', isActive: false }
])
const tab = ref<string>('测试1')

onMounted(() => {})

const changeTab = (value: { name: string; isActive: boolean; }) => {
  tab.value = value.name
  tabList.value.forEach((v) =>
    v.name === value.name ? (v.isActive = true) : (v.isActive = false)
  )
}
</script>
